home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / BLOOD.ZIP / BLOOD.PAS next >
Pascal/Delphi Source File  |  1994-01-30  |  1KB  |  65 lines

  1. program rain;
  2. var p:integer;
  3.  
  4. function keypressed : boolean; assembler; asm
  5.   mov ah,0bh; int 21h; and al,0feh; end;
  6.  
  7. Procedure RotatePal;
  8. Var a:Word;
  9. Begin
  10.   inc(p);
  11.   port[968]:=35;
  12.   a:=100;
  13.  
  14.   while port[$3da] and 8 <> 0 do;
  15.   while port[$3da] and 8 = 0 do;
  16.  
  17.   while a>1 do
  18.   begin
  19.     port[969]:=1-((a+p) and 60);
  20.     port[969]:=0;
  21.     {If you want a better palette selection and more play then remove
  22.      the above line and replace with the one below. It will allow you
  23.      to get to the blues and greens and yellows but I made mine red so
  24.      did not require those}
  25.     {port[969]:=1-((a+p) and 60);}
  26.     port[969]:=1-((a+p) and 65);
  27.     dec(a);
  28.     end;
  29. end;
  30.  
  31. Procedure makerain;
  32. Var
  33.   x,y,c,d:word;
  34. begin
  35.   d:=1;
  36.   randomize;
  37.   for x:=0 to 320 do
  38.   Begin
  39.     c:=random(65);
  40.     for y:=0 to 200 do
  41.     Begin
  42.       if c>64 then c:=1;
  43.       mem[$a000:x+320*y]:=c+35;
  44.       inc(c,d);
  45.     end;
  46.     d:=random(5)+1;
  47.   end;
  48. end;
  49.  
  50.  
  51. begin
  52. asm
  53.   mov ax,$0013
  54.   int 10h
  55.   end;
  56. makerain;
  57. repeat
  58. RotatePal;
  59. until keypressed;
  60. asm
  61.   mov ax,$0002
  62.   int 10h
  63. end;
  64. end.
  65.